<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateImagesTable extends Migration{
    public function up(){
        Schema::create('images', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->index();
            $table->enum('type',['avatar','topic'])->index();
            $table->string('path')->index();
            $table->timestamps();
        });
    }


    public function down(){
        Schema::dropIfExists('images');
    }
}